/**
 * @param {string} haystack
 * @param {string} needle
 * @return {number}
 */
var strStr = function (haystack, needle) {
  let len = haystack.length;
  let leedlelen = needle.length;
  for (let i = 0; i < len - leedlelen; i++) {
    if (haystack.startsWith(needle, i)) {
      return i;
    }
  }
  return -1;
};